package interview.base.writeexam;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.CyclicBarrier;

public class ExamSecond {

    public static void main(String[] args) {
        Thread[]  threads = new Thread[3];
        for(int i=0;i<threads.length;i++){
            threads[i] = new Thread(new Runnable() {
                @Override
                public void run() {

                    for(int j=0;j<5;j++){
                        System.out.print(j);
                    }
                    System.out.println("");

                }
            });
        }

        for(Thread thread:threads){
            thread.start();
        }

        int count = 0;
        int num = 0;
        for(int i=0;i<100;i++){

            num=num+i;
           // count = count++;
            count = count+1;
        }

        System.out.println("num="+num+",count:"+count);
        System.out.println("num*count="+(num*count));


    /*    System.out.println("线程是否会被打断");
        Thread thread = new Thread();
        try {
            thread.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }


        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }


        List<User> userList = new ArrayList<>();
        try {
            userList.wait();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }


        CyclicBarrier cyclicBarrier = new CyclicBarrier(2);
        try {
            cyclicBarrier.await();
        } catch (InterruptedException e) {
            e.printStackTrace();
        } catch (BrokenBarrierException e) {
            e.printStackTrace();
        }*/


        Integer  i1 = 128;
        Integer i2 = 128;
        System.out.println(i1==i2);   //false
        String i3 = "100";
        String i4 = "1"+new String("00");
        System.out.println(i3==i4+","); //true
        Integer i5 = 100;
        Integer i6 = 100;
        System.out.println(i5==i6);//true


    }
}
